<!DOCTYPE html>
<html class="bg-white">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <title>添加相册信息表</title>

</head>

<body>

<form id="photoalbumForm" lay-filter="photoalbumForm" class="layui-form model-form">


    <div class="layui-form-item">
        <label class="layui-form-label">相册名称</label>
        <div class="layui-input-block">
            <input name="albumName" id="albumName" placeholder="请输入相册名称" type="text" class="layui-input"
                   lay-verify="required" required/>
        </div>
    </div>
<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label">相册类型</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input name="albumType" id="albumType" placeholder="请输入相册类型" type="text" class="layui-input"-->
<!--                   lay-verify="required" required/>-->
<!--        </div>-->
<!--    </div>-->
    <div class="layui-form-item text-right">
        <button class="layui-btn" lay-filter="formSubmit" lay-submit>保存</button>
        <!--        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>-->
    </div>
</form>

<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/jquery-3.2.1.min.js}"></script>
<script th:inline="javascript">
    layui.use(['layer', 'form'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;

        var url = 'add';

        // 表单提交事件
        form.on('submit(formSubmit)', function (data) {
            layer.load(2);
            $.post(url, data.field, function (data) {
                layer.closeAll('loading');
                if (data.code == 200) {
                    top.layer.msg(data.msg, {icon: 1});
                    // 关闭当前iframe弹出层
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                } else {
                    top.layer.msg(data.msg, {icon: 2});
                }
            });
            return false;
        });

    });
</script>

</body>
</html>